package com.beiwei.mode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.beiwei.auto.mode.Company;
import com.beiwei.auto.mode.Permission;
import com.beiwei.auto.mode.User;

public class VUser extends User implements Serializable {

	private static final long serialVersionUID = 1L;

	public VUser() {
	}

	public VUser(User user) {
		this.setCreatetime(user.getCreatetime());
		this.setDelFlag(user.getDelFlag());
		this.setLocked(user.getLocked());
		this.setPassword(user.getPassword());
		this.setSalt(user.getSalt());
		this.setUsercode(user.getUsercode());
		this.setUserCompanyId(user.getUserCompanyId());
		this.setUserId(user.getUserId());
		this.setUserJobId(user.getUserJobId());
		this.setUsername(user.getUsername());
		this.setUserRoleIds(user.getUserRoleIds());
		this.setUserRoles(Arrays.asList(user.getUserRoleIds().split(",")));
	}

	private List<Permission> menus = new ArrayList<Permission>();// 用户菜单
	private List<Permission> permissions = new ArrayList<Permission>();// 用户所有权限
	private List<String> userRoles = new ArrayList<String>();// 用户所拥有的的身份
	private Company userCompany;// 该用户所在的公司

	public List<Permission> getMenus() {
		return menus;
	}

	public void setMenus(List<Permission> menus) {
		this.menus = menus;
	}

	public List<Permission> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}

	public List<String> getUserRoles() {
		return userRoles;
	}

	public void setUserRoles(List<String> userRoles) {
		this.userRoles = userRoles;
	}

	public Company getUserCompany() {
		return userCompany;
	}

	public void setUserCompany(Company userCompany) {
		this.userCompany = userCompany;
	}

}